package com.beefix.beans;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class HelloWorld {

	public static void main(String[] args) {

		// 通过 Spring 的 IOC 容器创建 Student 类实例
		// 1.创建IOC容器对象
		ApplicationContext iocContainer = new ClassPathXmlApplicationContext("applicationContext.xml");
		// 2.根据id获取bean实例对象
		Student student = (Student) iocContainer.getBean("student");
//		student.hello();
		
		
		Car car = iocContainer.getBean("car", Car.class);
		System.out.println(car);
		
		Car car2 = iocContainer.getBean("car2", Car.class);
		System.out.println(car2);
		
		Person person = iocContainer.getBean("person", Person.class);
		System.out.println(person);
	}

}
